import 'package:app/shared/constants/common.dart';
import 'package:flutter/material.dart';

import 'mock.dart';

class TextMessage extends StatelessWidget {
  const TextMessage({
    Key? key,
    required this.message,
  }) : super(key: key);

  final ChatMessage message;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(
          horizontal: sDefaultMarginPadding,
          vertical: sDefaultMarginPadding * 1.5),
      decoration: BoxDecoration(
          color: Colors.green.withOpacity(message.isSender ? 1 : 0.08),
          borderRadius: BorderRadius.circular(30)),
      child: Text(
        message.text,
        style: TextStyle(color: message.isSender ? Colors.white : sTextColor),
      ),
    );
  }
}
